<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>菜鸟教程(runoob.com)</title>
    <script src="http://cdn.static.runoob.com/libs/jquery/1.10.2/jquery.min.js">
    </script>
    <script>
        $(document).ready(function () {
            $("button").click(function () {
                $("#div1").load("demo_test.php", function (responseTxt, statusTxt) {
                    if (statusTxt == "success") {
                        alert("请求成功");
                    } else if (statusTxt == "error") {
                        alert("请求失败");
                    }
                    alert("数据: " + responseTxt + "\n状态: " + statusTxt);
                });
            });
        });
    </script>
</head>
<body>

<div id="div1"><h2>使用 jQuery AJAX 修改文本内容</h2></div>
<button>获取外部内容</button>

</body>
</html>